package com.project651.www;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button startGame = (Button) findViewById(R.id.startgame);
        startGame.setOnClickListener(this);
        startGame.setText("Start Game");
        
        Button joinGame = (Button) findViewById(R.id.joingame);
        joinGame.setOnClickListener(this);
        joinGame.setText("Join Game");
        
    }

	public void onClick(View arg0) {
		Intent i;
		switch(arg0.getId()) {
		case R.id.startgame:
			//server
			i = new Intent("Server");
			i.setClass(this, StartGame.class);
			startActivity(i);
			
			break;
		case R.id.joingame:
			//client
			i = new Intent("Client");
			i.setClass(this, JoinGameKeyboard.class);
			startActivity(i);
			
			break;
		}
		
	}
}